home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Utilities
/
Converters
/
Convert_PICT
/
Source
/
CommentedPSCode
/
makeUncommented
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
29 lines
#! /bin/csh
# Run this from within the CommentedPSCode directory, or it won't work quite right.
#
# This quick hack simply takes each of the files of PS code, and runs them through a
# simple AWK script which removes blank lines and any line made up of only a PS
# comment (with optional leading space) and dumps the results into UncommentedPSCode.
# This drastically reduces the size of the files (also drastically increassing their
# unclarity). A better script might get rid of those PS comments that come at the end
# of a line, after some PS code. An ambitious one might try to identify variables and
# shorten their names. Of course, one can also reduce indenting, move {}'s and defs onto
# other lines. Etc. I provide this only as a minimal service, for I shan't use it at all.
# if you improve upon this script, I'd be happy to recieve a copy, though.
# David John Burrowes
set DestCode = ../UncommentedPSCode
if (! -d $DestCode ) then
echo "Creating Uncommented code folder ($DestCode)"
mkdir $DestCode
chmod 777 $DestCode
endif
echo "Copying PS code files (while removing most comments) to UncommentedPSCode."
foreach psfile (Arcs Bitmaps Comments Common Lines Miscellaneous Ovals Patterns Colors Polygons Text Regions Rectangles RoundRectangles)
echo " Doing $psfile"
awk '/^$/ {next} /^%BEGIN/ {print $0} /^%END/ {print $0} /^[ \t]*%/ {next} {print $0}' $psfile > ../UncommentedPSCode/$psfile
end